<template>
  <transition name="el-zoom-in-center">
    <div class="JNPF-preview-main">
      <Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false"/>
      <div class="JNPF-common-page-header">
        <el-page-header @back="goBack"
                        content="详情"/>
        <div class="options">
          <el-button @click="goBack">取 消</el-button>
        </div>
      </div>
      <el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
        <el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="top">
          <template v-if="!loading">
            <el-col :span="24">
              <jnpf-form-tip-item label-width="0">
                <JnpfText
                  :textStyle='{"color":"#1684FC","font-weight":"bold","text-decoration":"none","font-size":24,"line-height":32,"font-style":"normal","text-align":"center"}'
                  :closable="false" content="项目信息">
                </JnpfText>
              </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24">
              <jnpf-form-tip-item label="创建项目状态"
                                  prop="createProjectStatus">
                <p>{{ dataForm.createProjectStatus }} </p>
              </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24">
              <jnpf-form-tip-item label-width="0">
                <JnpfGroupTitle
                  contentPosition="left" :closable="false" content="项目立项信息">
                </JnpfGroupTitle>
              </jnpf-form-tip-item>
            </el-col>
            <el-col :span="4">
              <el-row :gutter="15">
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <JnpfText
                      :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                      :closable="false">
                    </JnpfText>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="16">
              <el-row :gutter="15">
                <el-col :span="12">
                  <jnpf-form-tip-item label="企业名称"
                                      prop="enterpriseName">
                    <p>{{ dataForm.enterpriseName }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="企业信用代码"
                                      prop="enterpriseCreditCode">
                    <p>{{ dataForm.enterpriseCreditCode }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="企业简介"
                                      prop="enterpriseIntroduce">
                    <p>{{ dataForm.enterpriseIntroduce }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="项目名称"
                                      prop="projectName">
                    <p>{{ dataForm.projectName }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="项目负责人"
                                      prop="projectLeader">
                    <p>{{ dataForm.projectLeader }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="联系电话"
                                      prop="phone">
                    <p>{{ dataForm.phone }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="所属行业"
                                      prop="industry">
                    <p>{{ dataForm.industry }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="细分行业"
                                      prop="specificIndustry">
                    <p>{{ dataForm.specificIndustry }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="区县"
                                      prop="county">
                    <p>{{ dataForm.county }} </p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="数字化自测评等级"
                                      prop="digitalLelfassessmentLevel">
                    <p>{{ dataForm.digitalLelfassessmentLevel }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="评测分数"
                                      prop="digitalScore">
                    <JnpfNumber v-model="dataForm.digitalScore"
                                placeholder="请输入" disabled
                                :style='{"width":""}' :step="1" :precision="2">
                    </JnpfNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="14">
                  <jnpf-form-tip-item label="实施改造后预期数字化水平等级"
                                      prop="aftertransformationDigitalLevel">
                    <p>{{ dataForm.aftertransformationDigitalLevel }} </p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="10">
                  <jnpf-form-tip-item label="预评测分数"
                                      prop="aftertransformationScore">
                    <JnpfNumber v-model="dataForm.aftertransformationScore"
                                placeholder="请输入" disabled
                                :step="1" :precision="2">
                    </JnpfNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="个性需求"
                                      prop="individualNeeds">
                    <p>{{ dataForm.individualNeeds }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="服务商名称"
                                      prop="serverName">
                    <p>{{ dataForm.serverName }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="服务商统一社会信用代码"
                                      prop="serverCreditCode">
                    <p>{{ dataForm.serverCreditCode }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="项目类别"
                                      prop="projectType">
                    <p>{{ dataForm.projectType }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="预算类别"
                                      prop="budgetType">
                    <p>{{ dataForm.budgetType }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="项目内容"
                                      prop="projectContent">
                    <p>{{ dataForm.projectContent }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="数字化现状"
                                      prop="digitalCurrentState" tip-label="（简述企业在“数字化基础、数字化经营、数字化管理、数字化成效”方面现在的情况）">
                    <p>{{ dataForm.digitalCurrentState }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="预期成效"
                                      prop="expectedResults" tip-label="围绕提质、增效、降本、减存、绿色、安全等方面对改造预期成效做描述）">
                    <p>{{ dataForm.expectedResults }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="开始日期"
                                      prop="startDate">
                    <p>{{ dataForm.startDate }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="结束日期"
                                      prop="endDate">
                    <p>{{ dataForm.endDate }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2>数字化改造产品或服务预算</h2>
                    </div>
                    <el-table :data="dataForm.tableField131" size='mini'>
                      <el-table-column type="index" width="50" label="序号" align="center"/>
                      <el-table-column prop="budgetName" label="预算名称">
                        <template slot-scope="scope">
                          <p>{{ scope.row.budgetName }}</p>
                        </template>
                      </el-table-column>
                      <el-table-column prop="budgetMoney" label="预算金额(万元)">
                        <template slot-scope="scope">
                          <JnpfNumber v-model="scope.row.budgetMoney"
                                      placeholder="请输入" disabled
                                      :step="1" addonAfter="万元">
                          </JnpfNumber>
                        </template>
                      </el-table-column>
                    </el-table>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2>其他支出预算</h2>
                    </div>
                    <el-table :data="dataForm.tableField134" size='mini'>
                      <el-table-column type="index" width="50" label="序号" align="center"/>
                      <el-table-column prop="budgetName" label="预算小类（除了以上1-4项外的支出项，按实际增加行数）">
                        <template slot-scope="scope">
                          <p>{{ scope.row.budgetName }}</p>
                        </template>
                      </el-table-column>
                      <el-table-column prop="budgetMoney" label="预算金额(万元)">
                        <template slot-scope="scope">
                          <JnpfNumber v-model="scope.row.budgetMoney"
                                      placeholder="请输入" disabled
                                      :step="1" addonAfter="万元">
                          </JnpfNumber>
                        </template>
                      </el-table-column>
                    </el-table>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="数字化改造产品或服务预算合计(万元)"
                                      prop="digitalBudgetTotal">
                    <p>{{ dataForm.digitalBudgetTotal }}万元</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="其他支出项预算合计(万元)"
                                      prop="otherDigitalTotal">
                    <p>{{ dataForm.otherDigitalTotal }}万元</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="总预算（万元）"
                                      prop="generalBudget">
                    <p>{{ dataForm.generalBudget }}万元</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="拟支持数字化改造资金（万元）"
                                      prop="digitalRenovationFunds">
                    <JnpfNumber v-model="dataForm.digitalRenovationFunds"
                                placeholder="请输入" disabled
                                :step="1" :precision="2" addonAfter="万元">
                    </JnpfNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="是否有贷款需求"
                                      prop="isLoan">
                    <p>{{ dataForm.isLoan }} </p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="意向贷款金额(万元)"
                                      prop="loanMoney">
                    <JnpfNumber v-model="dataForm.loanMoney"
                                placeholder="请输入" disabled
                                :step="1" addonAfter="万元">
                    </JnpfNumber>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="真实性承诺"
                                      prop="authenticityCommitment">
                    <p>{{ dataForm.authenticityCommitment }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="数字化改造产品或服务预算明细附件"
                                      prop="digitalBudgetFiles">
                    <JnpfUploadFile v-model="dataForm.digitalBudgetFiles"
                                    disabled
                                    detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath"
                                    :isAccount="0" buttonText="点击上传">
                    </JnpfUploadFile>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="其他支出项预算明细附件"
                                      prop="otherBudgetFiles">
                    <JnpfUploadFile v-model="dataForm.otherBudgetFiles"
                                    disabled
                                    detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath"
                                    :isAccount="0" buttonText="点击上传">
                    </JnpfUploadFile>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="数字化改造项目服务合同"
                                      prop="digitalServiceContractFiles">
                    <JnpfUploadFile v-model="dataForm.digitalServiceContractFiles"
                                    disabled
                                    detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath"
                                    :isAccount="0" buttonText="点击上传">
                    </JnpfUploadFile>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="数字化改造项目方案"
                                      prop="digitalProjectPlanFiles">
                    <JnpfUploadFile v-model="dataForm.digitalProjectPlanFiles"
                                    disabled
                                    detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath"
                                    :isAccount="0" buttonText="点击上传">
                    </JnpfUploadFile>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="福州市中小企业数字化转型试点被改造企业项目表 "
                                      prop="recordFormFiles">
                    <JnpfUploadFile v-model="dataForm.recordFormFiles"
                                    disabled
                                    detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath"
                                    :isAccount="0" buttonText="点击上传">
                    </JnpfUploadFile>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="验收状态"
                                      prop="checkStatus">
                    <p>{{ dataForm.checkStatus }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label="审核专家"
                                      prop="examExpert">
                    <p>{{ dataForm.examExpert }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="创建用户"
                                      prop="creatoruserid">
                    <p>{{ dataForm.creatoruserid }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="创建时间"
                                      prop="creatortime">
                    <p>{{ dataForm.creatortime }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="修改用户"
                                      prop="lastmodifyuserid">
                    <p>{{ dataForm.lastmodifyuserid }}</p>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="12">
                  <jnpf-form-tip-item label="修改时间"
                                      prop="lastmodifytime">
                    <p>{{ dataForm.lastmodifytime }}</p>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="4">
              <el-row :gutter="15">
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <JnpfText
                      :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                      :closable="false">
                    </JnpfText>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="24">
              <jnpf-form-tip-item label-width="0">
                <JnpfGroupTitle
                  contentPosition="left" :closable="false" content="季度进度填报">
                </JnpfGroupTitle>
              </jnpf-form-tip-item>
            </el-col>
            <el-col :span="4">
              <el-row :gutter="15">
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <JnpfText
                      :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                      :closable="false">
                    </JnpfText>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="16">
              <el-row :gutter="15">
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2>设计子表</h2>
                    </div>
                    <el-table :data="dataForm.tableField185" size='mini'>
                      <el-table-column type="index" width="50" label="序号" align="center"/>
                      <el-table-column prop="projectInseasonInvestment" label="项目当季完成投资金额 （万元）">
                        <template slot-scope="scope">
                          <p>{{ scope.row.projectInseasonInvestment }}</p>
                        </template>
                      </el-table-column>
                      <el-table-column prop="projectTotalInvestment" label="项目累计完成投资金额 （万元）">
                        <template slot-scope="scope">
                          <p>{{ scope.row.projectTotalInvestment }}</p>
                        </template>
                      </el-table-column>
                      <el-table-column prop="projectImageProgress" label="项目形象进度">
                        <template slot-scope="scope">
                          <p>{{ scope.row.projectImageProgress }}</p>
                        </template>
                      </el-table-column>
                    </el-table>
                  </jnpf-form-tip-item>
                </el-col>
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2>设计子表</h2>
                    </div>
                    <el-table :data="dataForm.tableField181" size='mini'>
                      <el-table-column type="index" width="50" label="序号" align="center"/>
                      <el-table-column prop="status" label="状态">
                        <template slot-scope="scope">
                          <p>{{ scope.row.status }}</p>
                        </template>
                      </el-table-column>
                    </el-table>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="4">
              <el-row :gutter="15">
                <el-col :span="24">
                  <jnpf-form-tip-item label-width="0">
                    <JnpfText
                      :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                      :closable="false">
                    </JnpfText>
                  </jnpf-form-tip-item>
                </el-col>
              </el-row>
            </el-col>
          </template>
        </el-form>
      </el-row>
    </div>
  </transition>
</template>
<script>
import request from '@/utils/request'

import {getConfigData} from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import {thousandsFormat} from "@/components/Generator/utils/index"

export default {
  components: {Detail},
  props: [],
  data() {
    return {
      visible: false,
      detailVisible: false,
      loading: false,

      dataForm: {
        id: '',
        createProjectStatus: "",
        enterpriseName: '',
        enterpriseCreditCode: '',
        enterpriseIntroduce: '',
        projectName: '',
        projectLeader: '',
        phone: '',
        industry: '',
        specificIndustry: '',
        county: "",
        digitalLelfassessmentLevel: '',
        digitalScore: '',
        aftertransformationDigitalLevel: '',
        aftertransformationScore: '',
        individualNeeds: '',
        serverName: '',
        serverCreditCode: '',
        projectType: "数字化改造",
        budgetType: "数字化改造",
        projectContent: '',
        digitalCurrentState: "<p>（简述企业在“数字化基础、数字化经营、数字化管理、数字化成效”方面现在的情况）</p>",
        expectedResults: "<p>围绕提质、增效、降本、减存、绿色、安全等方面对改造预期成效做描述）</p>",
        startDate: '',
        endDate: '',
        digitalBudgetTotal: '',
        otherDigitalTotal: '',
        generalBudget: '',
        digitalRenovationFunds: '',
        isLoan: '',
        loanMoney: '',
        authenticityCommitment: "",
        digitalBudgetFiles: [],
        otherBudgetFiles: [],
        digitalServiceContractFiles: [],
        digitalProjectPlanFiles: [],
        recordFormFiles: [],
        checkStatus: '',
        examExpert: '',
        creatoruserid: "",
        creatortime: "",
        lastmodifyuserid: "",
        lastmodifytime: "",
        fz_project_library_digital_budgetList: [],
        fz_project_library_other_digital_budgetList: [],
        fz_project_library_quarterly_progressList: [],
        fz_project_library_flow_taskList: [],
      },
      createProjectStatusOptions: [{"fullName": "项目备案", "id": "项目备案"}, {
        "fullName": "项目审核",
        "id": "项目审核"
      }, {"fullName": "进度填报", "id": "进度填报"}, {"fullName": "项目验收", "id": "项目验收"}],
      createProjectStatusProps: {"label": "fullName", "value": "id"},
      countyOptions: [{"fullName": "鼓楼区", "id": "鼓楼区"}, {"fullName": "台江区", "id": "台江区"}, {
        "fullName": "仓山区",
        "id": "仓山区"
      }, {"fullName": "马尾区", "id": "马尾区"}, {"fullName": "晋安区", "id": "晋安区"}, {
        "fullName": "长乐区",
        "id": "长乐区"
      }, {"fullName": "闽侯县", "id": "闽侯县"}, {"fullName": "连江县", "id": "连江县"}, {
        "fullName": "罗源县",
        "id": "罗源县"
      }, {"fullName": "闽清县", "id": "闽清县"}, {"fullName": "平潭县", "id": "平潭县"}, {
        "fullName": "福清市",
        "id": "福清市"
      }, {"fullName": "高新区", "id": "高新区"}],
      countyProps: {"label": "fullName", "value": "id"},
      aftertransformationDigitalLevelOptions: [{"fullName": "无等级", "id": "0"}, {
        "fullName": "一级",
        "id": "1"
      }, {"fullName": "二级", "id": "2"}, {"fullName": "三级", "id": "3"}, {"fullName": "四级", "id": "4"}],
      aftertransformationDigitalLevelProps: {"label": "fullName", "value": "id"},
      isLoanOptions: [{"fullName": "是", "id": "1"}, {"fullName": "否", "id": "0"}],
      isLoanProps: {"label": "fullName", "value": "id"},

    }
  },
  computed: {},
  watch: {},
  created() {

  },
  mounted() {
  },
  methods: {
    toDetail(defaultValue, modelId) {
      if (!defaultValue) return
      getConfigData(modelId).then(res => {
        if (!res.data || !res.data.formData) return
        let formData = JSON.parse(res.data.formData)
        formData.popupType = 'general'
        this.detailVisible = true
        this.$nextTick(() => {
          this.$refs.Detail.init(formData, modelId, defaultValue)
        })
      })
    },
    dataInfo(dataAll) {
      let _dataAll = dataAll
      this.dataForm = _dataAll
    },

    goBack() {
      this.$emit('refresh')
    },
    init(id) {
      this.dataForm.id = id || 0;
      this.visible = true;
      this.$nextTick(() => {
        if (this.dataForm.id) {
          this.loading = true
          request({
            url: '/api/example/Fz_poilt_project_library/detail/' + this.dataForm.id,
            method: 'get'
          }).then(res => {
            this.dataInfo(res.data)
            this.loading = false
          })
        }

      })
    },
  },
}

</script>
